<template>
  <view>
    <view class="w100 h-100 pl-24 pr-22">
      <view class="w100 h-68 br-34 bgff rowsb rowsm pl-36 pr-4" style="border: 2rpx solid #4886FF;">
        <input type="text" placeholder="输入姓名学号" placeholder-class="fs-26 col888">
        <view class="w-98 h-60 br-30 rowsc rowsm" style="background: linear-gradient(to bottom,#4897FF,#4878FF);">
          <image src="/static/icon_osbc-1.png" class="w-28 h-28" mode=""></image>
        </view>
      </view>
    </view>
    <view class="w100 rowsb rowsm h-102 fs-30 fw-b col333" style="background-color: #F7F6FA;">
      <view class="w-140 h100 rowsc rowsm">姓名</view>
      <view class="w100 h100 rowsc rowsm">班级</view>
      <view class="w-160 h100 rowsc rowsm">学号</view>
      <view class="w-120 h100 rowsc rowsm">操作</view>
    </view>
    
    <view class="w100 h-102 rowsb rowsm fs-30 col333" v-for="(item,index) in list" :key="index" :style="{'background-color':index % 2 != 0 ? '#F7F6FA' : '#fff'}">
      <view class="w-140 h100 rowsc rowsm">{{item.name}}</view>
      <view class="w100 h100 rowsc rowsm">{{item.bjName}}</view>
      <view class="w-160 h100 rowsc rowsm">{{item.stNumber}}</view>
      <view class="w-120 h100 rowsc rowsm">
        <view class="w-106 h-50 br-25 rowsc rowsm colfff fs-24" style="background: linear-gradient(to bottom,#4897FF,#4878FF);" @click="choseItem(item)">选择</view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        list:[]
      };
    },
    onLoad() {
      this.getList()
    },
    methods:{
      getList(){
        this.$tools.axiosFromToken('POST','prouser/list',{},'加载中').then(res => {
          if(res.code != 200) return this.$tools.showtt(res.msg)
          let {rows} = res
          this.list = rows
        })
      },
      choseItem(item){
        uni.$emit('choseStudent',item)
        this.$tools.goBack(1)
      }
    }
  }
</script>

<style lang="scss">
page {
  background-color: #fff;
}
</style>
